package spike.jdbc;

import static org.junit.Assert.*;

import java.io.File;

import org.junit.Test;

import spike.jdbc.model.Title;

public class TestTitleParser {

	@Test
	public void testOK() {
		TitleParser vParser = new TitleParser();
		
		Title vTitle = vParser.parse(new File("c:/music/Rolling Stones - Album unknown - Start me up.mp3"));
		
		assertEquals("titre", "Start me up", vTitle.getNom());
		assertEquals("artiste", "Rolling Stones", vTitle.getArtiste());
		assertEquals("album", "Album unknown", vTitle.getAlbum());
	}
	
	
	@Test
	public void testKO() {
		TitleParser vParser = new TitleParser();
		
		Title vTitle = vParser.parse(new File("c:/music/_Lola_- The Kinks.mp3"));
		
		assertEquals("titre", "Start me up", vTitle.getNom());
		assertEquals("artiste", "Rolling Stones", vTitle.getArtiste());
		assertEquals("album", "Album unknown", vTitle.getAlbum());
	}

}
